package com.financing.wap.dao.impl;


import java.sql.SQLException;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.financing.wap.common.SqlName;
import com.financing.wap.dao.IDstArticleCategoriesDao;
import com.financing.wap.dto.DstArticleCategoriesDTO;
import com.financing.wap.vo.UserArticleInfoCategoriesVO;
/**
 * dst_article_categories  
 * 文章分类 数据访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("dstArticleCategoriesDao")
public class DstArticleCategoriesDaoImpl extends BaseDaoImpl<DstArticleCategoriesDTO, java.lang.Integer> implements IDstArticleCategoriesDao {


	@SuppressWarnings("deprecation")
	@Override
	public int insert(DstArticleCategoriesDTO dstArticleCategories) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.insert(SqlName.DstArticleCategoriesSql.insert, dstArticleCategories);
	}

	@Override
	public void update(DstArticleCategoriesDTO dstArticleCategories) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.DstArticleCategoriesSql.update, dstArticleCategories);
	}

	@Override
	public void updateForce(DstArticleCategoriesDTO dstArticleCategories) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.DstArticleCategoriesSql.updateForce, dstArticleCategories);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		this.sqlMapClientTemplate.delete(SqlName.DstArticleCategoriesSql.delete,id);
	}
	
	@SuppressWarnings("unchecked")	
	@Override
	public List<DstArticleCategoriesDTO> queryList(DstArticleCategoriesDTO dstArticleCategories) throws SQLException {
		return this.sqlMapClientTemplate.queryForList(SqlName.DstArticleCategoriesSql.queryList, dstArticleCategories);
	}

	@Override
	public int queryListCount(DstArticleCategoriesDTO dstArticleCategories) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.queryForObject(SqlName.DstArticleCategoriesSql.queryListCount, dstArticleCategories);
	}

	@Override
	public DstArticleCategoriesDTO loadById(Integer id) throws SQLException {
		return  (DstArticleCategoriesDTO)this.getSqlMapClientTemplate().queryForObject(SqlName.DstArticleCategoriesSql.loadById,id);
	}

	@Override
	public Class<DstArticleCategoriesDTO> getEntityClass() {
		return DstArticleCategoriesDTO.class;
	}

}
